local sBannerPath = THEME:GetPathG("Common", "fallback banner");
local sJacketPath = THEME:GetPathG("Common", "fallback jacket");
local bAllowJackets = true

local t = Def.ActorFrame {
	Def.Sprite {
		Name="Banner";
		InitCommand=cmd(scaletoclipped,150,150;);
		-- Commands to make sure each banner gets the right look.
		BannerCommand=cmd(scaletoclipped,150,150);
		JacketCommand=cmd(scaletoclipped,150,150);
		-- Set em up the graphics.
		SetMessageCommand=function(self,params)
			local Song = params.Song;
			local Course = params.Course;
			-- We have a song, not course
			if Song then
				-- Have Jacket
				if ( Song:GetJacketPath() ~=  nil ) and ( bAllowJackets ) then
					self:Load( Song:GetJacketPath() );
					self:playcommand("Jacket");
				-- Use Background if we want Jackets
				elseif ( Song:GetBackgroundPath() ~= nil ) and ( bAllowJackets ) then
					self:Load( Song:GetBackgroundPath() );
					self:playcommand("Jacket");
				-- Use Banner if we dont care 
				elseif ( Song:GetBannerPath() ~= nil ) then
					self:Load( Song:GetBannerPath() );
					self:playcommand("Banner");
				-- Use Default
				else
				  self:Load( bAllowJackets and sBannerPath or sJacketPath );
				  self:playcommand( bAllowJackets and "Jacket" or "Banner" );
				end;
			elseif Course then
				-- We have a background (for jackets) 
				if ( Course:GetBackgroundPath() ~= nil ) and ( bAllowJackets ) then
					self:Load( Course:GetBackgroundPath() );
					self:playcommand("Jacket");
				-- We have a banner
				elseif ( Course:GetBannerPath() ~= nil ) then
					self:Load( Course:GetBannerPath() );
					self:playcommand("Banner");
				-- Get your defaults
				else
					self:Load( sJacketPath );
					self:playcommand( bAllowJackets and "Jacket" or "Banner" );
				end
			-- What the hell did you do?! 
			else
				self:Load( bAllowJackets and sJacketPath or sBannerPath );
				self:playcommand( bAllowJackets and "Jacket" or "Banner" );
			end;
		end;
	};
	
	LoadActor(THEME:GetPathG("_song", "overlay")) .. {
		InitCommand=cmd(scaletoclipped,160,160;;);
	};

};

return t;
	
-- Cute overlay

	
	
